/**
 * 节流
 * @param fn
 * @param wait
 * @returns {(function(): void)|*}
 */
export function throttle(fn,wait = 500) {
    let time = 0;
    return function(){
        let _this = this;
        let args = arguments;
        let now = Date.now();
        if(now - time > wait) {
            fn.apply(_this,args);
            time = now;
        }
    }
}
